import ScrollView from '../packages/scroll-view/index'
import LoadingMore from '../packages/load-more/index'
import Upload from '../packages/upload/index'
import Toast from '../packages/toast/index'
import {version} from '../package.json'

const components = [ScrollView, Upload, LoadingMore, Toast]
const install = function (Vue) {
  // 判断是否安装
  if (install.installed) {
    return
  }
  components.forEach((component) => {
    Vue.component(component.name, component)
  })
}

if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}

export default {version, install, ScrollView, LoadingMore, Upload, Toast}
